package com.smzd.utils.email;

import java.util.Map;

public class Email {
	private String emailHost;//发件人邮箱服务器
	private String emailFrom;//发件人邮箱
	private String emailUserName;//发件人用户名
	private String emailPassword;//发件人密码
	private String toEmails;//多个邮箱以;分割
	private String subject;//邮件主题
	private String content;//邮件内容
	private Map<String, String> pictures;//邮件中图片
	private Map<String, String> attachments;//邮件中附件
	
	public Email(){
		super();
	}
	
	public void send() throws Exception{
		EmailUtils.sendEmail(this);
	}
	
	public Email(String emailHost, String emailFrom, String emailUserName,
			String emailPassword, String toEmails, String subject,
			String content, Map<String, String> pictures,
			Map<String, String> attachments) {
		super();
		this.emailHost = emailHost;
		this.emailFrom = emailFrom;
		this.emailUserName = emailUserName;
		this.emailPassword = emailPassword;
		this.toEmails = toEmails;
		this.subject = subject;
		this.content = content;
		this.pictures = pictures;
		this.attachments = attachments;
	}

	public String getEmailHost() {  
        return emailHost;  
    }  
  
    public void setEmailHost(String emailHost) {  
        this.emailHost = emailHost;  
    }  
  
    public String getEmailFrom() { 
        return emailFrom;  
    }  
  
    public void setEmailFrom(String emailFrom) {  
        this.emailFrom = emailFrom;  
    }  
  
    public String getEmailUserName() { 
        return emailUserName;  
    }  
  
    public void setEmailUserName(String emailUserName) {  
        this.emailUserName = emailUserName;  
    }  
  
    public String getEmailPassword() {
        return emailPassword;  
    }  
  
    public void setEmailPassword(String emailPassword) {  
        this.emailPassword = emailPassword;  
    }  
  
    public String getToEmails() {  
        return this.toEmails;  
    }  
  
    public void setToEmails(String toEmails) {  
        this.toEmails = toEmails;  
    }  
  
    public String getSubject() { 
        if ("".equals(subject)||subject==null) {  
            subject = "无主题";  
        }  
        return this.subject;  
    }  
  
    public void setSubject(String subject) {  
        this.subject = subject;  
    }  
  
    public String getContent() {  
        return this.content;  
    }  
  
    public void setContent(String content) {  
        this.content = content;  
    }  

    public Map<String, String> getPictures() {  
        return pictures;  
    }  
  
    public void setPictures(Map<String, String> pictures) {  
        this.pictures = pictures;  
    }  
  
    public Map<String, String> getAttachments() {  
        return this.attachments;  
    }  
  
    public void setAttachments(Map<String, String> attachments) {  
        this.attachments = attachments;  
    }
	
}
